package com.qingge.springboot.config;

import com.qingge.springboot.common.Constants;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author linyanbin
 * @date 2022/7/16 18:02
 */
@Configuration
public class PictureConfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //指的是对外暴露的访问路径
        registry.addResourceHandler(Constants.PHOTO_SHOW_PATH+ "/**")
                //指的是内部文件放置的目录
                .addResourceLocations("file:"+ Constants.PHOTO_PATH);
    }
}
